package com.mes.utils.express;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * 快递鸟下单实体
 *
 */
public class KdnOrderEntity implements Serializable {

	private static final long serialVersionUID = 1L;
	
	
	@JsonProperty("OrderCode")
	private String orderCode;
	
	@JsonProperty("ShipperCode")
	private String shipperCode;
	
	@JsonProperty("PayType")
	private int payType;
	
	@JsonProperty("ExpType")
	private int expType;
	
	@JsonProperty("Cost")
	private double cost;
	
	@JsonProperty("OtherCost")
	private double otherCost;
	
	@JsonProperty("Weight")
	private double weight;
	
	@JsonProperty("Quantity")
	private int quantity;
	
	@JsonProperty("Volume")
	private double volume;
	
	@JsonProperty("Remark")
	private String remark;
	
	@JsonProperty("IsReturnPrintTemplate")
	private int isReturnPrintTemplate;
	
	@JsonProperty("Sender")
	private SenderReceiver sender;
	
	@JsonProperty("Receiver")
	private SenderReceiver receiver;
	
	@JsonProperty("Commodity")
	private List<Commodity> commodities;
	
	public void addCommodity(Commodity commodity) {
		if(this.commodities == null) {
			this.commodities = new ArrayList<>();
			this.commodities.add(commodity);
		} else {
			this.commodities.add(commodity);
		}
	}
	
	public String getOrderCode() {
		return orderCode;
	}

	public void setOrderCode(String orderCode) {
		this.orderCode = orderCode;
	}

	public String getShipperCode() {
		return shipperCode;
	}

	public void setShipperCode(String shipperCode) {
		this.shipperCode = shipperCode;
	}

	public int getPayType() {
		return payType;
	}

	public void setPayType(int payType) {
		this.payType = payType;
	}

	public int getExpType() {
		return expType;
	}

	public void setExpType(int expType) {
		this.expType = expType;
	}

	public double getCost() {
		return cost;
	}

	public void setCost(double cost) {
		this.cost = cost;
	}

	public double getOtherCost() {
		return otherCost;
	}

	public void setOtherCost(double otherCost) {
		this.otherCost = otherCost;
	}

	public double getWeight() {
		return weight;
	}

	public void setWeight(double weight) {
		this.weight = weight;
	}

	public int getQuantity() {
		return quantity;
	}

	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}

	public double getVolume() {
		return volume;
	}

	public void setVolume(double volume) {
		this.volume = volume;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public int getIsReturnPrintTemplate() {
		return isReturnPrintTemplate;
	}

	public void setIsReturnPrintTemplate(int isReturnPrintTemplate) {
		this.isReturnPrintTemplate = isReturnPrintTemplate;
	}

	public SenderReceiver getSender() {
		return sender;
	}

	public void setSender(SenderReceiver sender) {
		this.sender = sender;
	}

	public SenderReceiver getReceiver() {
		return receiver;
	}

	public void setReceiver(SenderReceiver receiver) {
		this.receiver = receiver;
	}

	public List<Commodity> getCommodities() {
		return commodities;
	}

	public void setCommodities(List<Commodity> commodities) {
		this.commodities = commodities;
	}


	class SenderReceiver{
		@JsonProperty("Company")
		private String company;
		@JsonProperty("Name")
		private String name;
		@JsonProperty("Mobile")
		private String mobile;
		@JsonProperty("ProvinceName")
		private String provinceName;
		@JsonProperty("CityName")
		private String cityName;
		@JsonProperty("ExpAreaName")
		private String expAreaName;
		@JsonProperty("Address")
		private String address;
		
		public SenderReceiver() {
			super();
		}
		
		public SenderReceiver(String company, String name, String mobile, String provinceName, String cityName,
				String expAreaName, String address) {
			super();
			this.company = company;
			this.name = name;
			this.mobile = mobile;
			this.provinceName = provinceName;
			this.cityName = cityName;
			this.expAreaName = expAreaName;
			this.address = address;
		}

		public String getCompany() {
			return company;
		}

		public void setCompany(String company) {
			this.company = company;
		}

		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}

		public String getMobile() {
			return mobile;
		}

		public void setMobile(String mobile) {
			this.mobile = mobile;
		}

		public String getProvinceName() {
			return provinceName;
		}

		public void setProvinceName(String provinceName) {
			this.provinceName = provinceName;
		}

		public String getCityName() {
			return cityName;
		}

		public void setCityName(String cityName) {
			this.cityName = cityName;
		}

		public String getExpAreaName() {
			return expAreaName;
		}

		public void setExpAreaName(String expAreaName) {
			this.expAreaName = expAreaName;
		}

		public String getAddress() {
			return address;
		}

		public void setAddress(String address) {
			this.address = address;
		}

	}
	
	class Commodity{
		@JsonProperty("GoodsName")
		private String goodsName;
		@JsonProperty("Goodsquantity")
		private int goodsquantity;
		@JsonProperty("GoodsWeight")
		private double goodsWeight;
		
		public Commodity() {
			super();
		}

		public Commodity(String goodsName, int goodsquantity, double goodsWeight) {
			super();
			this.goodsName = goodsName;
			this.goodsquantity = goodsquantity;
			this.goodsWeight = goodsWeight;
		}

		public String getGoodsName() {
			return goodsName;
		}

		public void setGoodsName(String goodsName) {
			this.goodsName = goodsName;
		}

		public int getGoodsquantity() {
			return goodsquantity;
		}

		public void setGoodsquantity(int goodsquantity) {
			this.goodsquantity = goodsquantity;
		}

		public double getGoodsWeight() {
			return goodsWeight;
		}

		public void setGoodsWeight(double goodsWeight) {
			this.goodsWeight = goodsWeight;
		}
		
	}
}
